1. Field of the Invention
This invention relates to a semiconductor memory system with a data copying function and a data copying method for the memory system, and more particularly to the technique for rewriting data in pages in a NAND flash memory where data is erased in blocks.
2. Description of the Related Art
One known nonvolatile semiconductor memory device is a NAND flash memory. In a NAND flash memory, memory cells are cascade-connected, thereby reducing the number of contacts for the select gates and bit lines, which makes the chip size smaller than that of a NOR flash memory. However, the data cannot be erased in pages and has to be erased in blocks (or in units of pages sandwiched between select gates). Therefore, although the chip size can be made smaller, the user must erase or rewrite the data in larger units (or in blocks). This limitation makes it complicated to use the NAND flash memory.
In a case where data can be erased in pages as in a NOR flash memory, to rewrite page data, the original page is erased and the page data to be overwritten is programmed there. In contrast, in a NAND flash memory, since data has to be erased in blocks, not only the page to be erased but also the remaining pages in the same block are also erased. For this reason, to write data into a physical page data area in which data has already been written, the data in the remaining pages in the same block has to be read and saved and, after the block is erased, the saved data has to be programmed again.
Such a rewrite operation is very complex and takes time. Thus, when data is rewritten in pages, a method of programming the rewritten data physically into other empty blocks (or erased blocks) is used. In this method, however, physical addresses of the page data change. For this reason, the process of causing the physically changed addresses to correspond to apparent addresses seen from the outside is required. Generally, this process is carried out at a controller.
To cause externally seen addresses to correspond to internal physical addresses, a method of making a table for each page has been proposed. When a conversion table is made for each page, this makes the data size of the conversion tables larger. Therefore, the former is generally caused to correspond to the latter in units of a plurality of pages.
As described above, in a NAND flash memory, to rewrite data in pages, it is necessary to copy the remaining pages in the same replacement unit (block) into the move destination block.
Two conventional methods of copying page data into another page in a NAND flash memory will be explained in further detail by reference to flowcharts in FIGS. 1 and 2. In a first method, page data is read temporarily into the page buffer in the chip as shown in FIG. 1 (STEP 1). Next, the address for the copy destination page is inputted (STEP 2). Then, a program command is inputted (STEP 3) to read the statues (STEP 4).
In the first method, if an error has occurred in part of the data when the data is read into the page buffer, the erroneous data is programmed directly into another page. If a similar page copy of the page has been made and a new error has occurred, it follows that the preceding errors and the newly occurred error are programmed. As described above, in the conventional page copying operation, even if an error has occurred in reading, it cannot be detected. When a copy is made many times, errors can accumulate.
Another method (a second method) of copying page data into another page is to carry out normal read and write operations as shown in FIG. 2. In this method, first, the page data is read outside the chip (STEP 1, STEP 2). Next, the address for the copy destination address is inputted (STEP 3) and the read-out page data, or the previously outputted page data, is inputted (STEP 4). Thereafter, a program command is inputted (STEP 5) and the status is read (STEP 6).
In the second method, since the page data is read temporarily outside the chip, if an error has occurred in part of the page data, it is possible to detect and correct the error at a controller. However, since the page data is read outside the chip and the data is then inputted to the copy destination address again, it takes time to carry out the copy operation.